package library.http;

import android.support.annotation.NonNull;

/**
 * Created by Mr.Fan on 2017/1/11.
 */

public class HttpHandler extends HttpThread {

    public HttpHandler(@NonNull HttpTask httpTask) {
        super(httpTask);
    }

    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        HttpManager.addTask(HttpManager.key(httpTask.getTag()), this);
    }

    @Override
    protected void onPostExecute(Object result) {
        super.onPostExecute(result);
        HttpManager.remove(HttpManager.key(httpTask.getTag()), this);
    }

    @Override
    protected void onCancelled() {
        super.onCancelled();
        HttpManager.remove(HttpManager.key(httpTask.getTag()), this);
    }
}
